﻿@inherits CmsWebViewPage

@{
	Layout = null;

	var pager = new PagedDataSummary();

	if (CmsPage.TheSite.Blog_Root_ContentID.HasValue && CmsPage.ThePage.Root_ContentID == CmsPage.TheSite.Blog_Root_ContentID.Value) {
		pager.ContentType = PagedDataSummary.SummaryContentType.Blog;
		pager.PageSize = 10;
		pager.IgnoreSitePath = false;
		pager.FetchData();
	} else {
		pager.PageSize = 1;
		pager.ContentType = PagedDataSummary.SummaryContentType.Unknown;
	}

	ViewBag.Title = CmsPage.Titlebar;
	ViewBag.SiteName = CmsPage.TheSite.SiteName;

	TwoLevelNavigation nav = new TwoLevelNavigation() {
		FontSize = new SizeUnit("14px"),
		ForeColor = System.Drawing.ColorTranslator.FromHtml("#424242"),
		SelFGColor = System.Drawing.ColorTranslator.FromHtml("#ffffff"),
		SubBGColor = System.Drawing.ColorTranslator.FromHtml("#787878"),
		SubFGColor = System.Drawing.ColorTranslator.FromHtml("#ffffff"),
		UnSelBGColor = System.Drawing.ColorTranslator.FromHtml("#808080"),
		UnSelFGColor = System.Drawing.ColorTranslator.FromHtml("#eeeeee"),
	};
}

<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />

	@CarrotCakeHtml.MetaTags()
	@CarrotCakeHtml.Rss()

	@(new jquerybasic() { SelectedSkin = jquerybasic.jQueryTheme.GlossyBlack, UseJqueryMigrate = true })

	<script type="text/javascript">
		function doButtonStyle() {
			$("input:button, input:submit, input:reset, button").button();
		}

		$(document).ready(function () {
			doButtonStyle();
		});

		$(document).ajaxComplete(function (event, xhr, settings) {
			doButtonStyle();
		});
	</script>

	<title>@CmsPage.Titlebar</title>

	<style type="text/css">
		body {
			margin: 0;
			padding: 0;
			background: #FFFFFF;
			font-family: Arial, Helvetica, sans-serif;
			font-size: 12px;
			color: #787878;
		}

		h1, h2, h3 {
			margin: 0;
			padding: 0;
			font-weight: normal;
			color: #000000;
			margin-bottom: 5px;
		}

		h1 {
			font-size: 2.5em;
		}

		h2 {
			font-size: 2em;
		}

		h3 {
			font-size: 1.5em;
		}

		p, ul, ol {
			margin-top: 0;
			line-height: 180%;
		}

		a {
			text-decoration: none;
			color: #424242;
		}

			a:hover {
				text-decoration: underline;
				color: #333333;
			}

		#wrapper {
			width: 980px;
			margin: 0 auto;
			padding: 0;
		}

		/* Header */

		#header {
			clear: both;
			width: 980px;
			height: 300px;
			margin: 0 auto;
			padding: 0;
		}

		/* Menu */

		#menu {
			width: 940px;
			margin: 0 auto;
			padding: 0;
			padding-bottom: 10px;
		}

		/* Page */

		#page {
			width: 940px;
			margin: 0 auto;
			padding: 0 0 0 0;
		}

		#page-bgtop {
			padding: 10px 0;
		}

		/* Content */

		#content {
			float: right;
			width: 590px;
			padding: 20px 0 0 0;
		}

		.text-danger {
			color: #990000;
		}

		.searchbox {
			background: #ffffff url("") no-repeat scroll 4px 4px;
			padding: 0.1em 0.1em 0.1em 25px;
			font-size: 14pt;
			width: 175px;
		}

		.post {
			margin-bottom: 15px;
		}

			.post .title {
				height: 40px;
				margin-bottom: 10px;
				padding: 12px 0 0 0;
				letter-spacing: -.5px;
				color: #82050B;
			}

				.post .title a {
					color: #82050B;
					border: none;
				}

			.post .entry {
				padding: 0 0 20px 0;
				padding-bottom: 20px;
				text-align: justify;
			}

		.links {
			padding-top: 20px;
			font-size: 12px;
			font-weight: bold;
		}

		/* Sidebar */

		#sidebar {
			float: left;
			width: 290px;
			margin: 0;
			padding: 0 0 0 0;
			color: #787878;
		}

			#sidebar ul {
				margin: 0;
				padding: 0;
				list-style: none;
			}

			#sidebar li {
				margin: 0;
				padding: 0;
			}

				#sidebar li ul {
					margin: 0 0;
					padding-bottom: 30px;
				}

				#sidebar li li {
					line-height: 25px;
					margin: 0 30px 15px;
					border-left: none;
					border-bottom: dotted 1px #737373;
				}

			#sidebar h2 {
				height: 30px;
				padding-left: 30px;
				letter-spacing: -.5px;
				font-size: 1.8em;
			}

			#sidebar p {
				margin: 0 0;
				padding: 0 30px 20px 30px;
				text-align: justify;
			}

			#sidebar a {
				border: none;
			}

				#sidebar a:hover {
					text-decoration: underline;
					color: #8A8A8A;
				}

		/* Footer */

		#footer {
			height: 50px;
			margin: 0 auto;
			padding: 0 0 15px 0;
			background: #ECECEC;
			border-top: 1px solid #DEDEDE;
			font-family: Arial, Helvetica, sans-serif;
		}

			#footer p {
				margin: 0;
				padding-top: 20px;
				line-height: normal;
				font-size: 9px;
				text-transform: uppercase;
				text-align: center;
				color: #A0A0A0;
			}

			#footer a {
				color: #8A8A8A;
			}

		/* OTHER */

		.aligncenter, div.aligncenter {
			display: block;
			margin-left: auto;
			margin-right: auto;
		}

		.alignleft {
			float: left;
		}

		.alignright {
			float: right;
		}

		/* pager */

		.pagerfooterlinks {
			line-height: normal;
			color: #ffffff;
		}

			.pagerfooterlinks .pagerlink {
				margin: 2px 2px 2px 2px;
				padding: 5px 5px 5px 5px;
				border: 2px solid #333333;
				background-color: #cccccc;
				float: left;
			}

				.pagerfooterlinks .pagerlink a {
					margin: 2px 2px 2px 2px;
					padding: 5px 5px 5px 5px;
					font-weight: bold;
					color: #666666;
				}

					.pagerfooterlinks .pagerlink a.selected {
						color: #ffffff;
						font-weight: bold;
					}

			.pagerfooterlinks .selectedwrap {
				color: #ffffff;
				background-color: #333333;
				font-weight: bold;
			}
	</style>

	@CarrotWeb.RenderTwoPartControlBodyCss(nav)

	@CarrotCakeHtml.IncludeHead()
</head>
<body>

	<div id="wrapper">
		<h1 id="logo">
			<a href="~/">
				@ViewBag.SiteName
			</a>
		</h1>
		<p>
		</p>
		<div id="menu">
			@CarrotWeb.RenderTwoPartControlBody(nav)
		</div>
		<div style="clear: both;">
		</div>
		<!-- end #menu -->
		<div id="page">
			<div id="BreadCrumbNavigation">
				@CarrotCakeHtml.GetBreadCrumbNavigation()
			</div>

			<div id="page-bgtop">
				<div id="page-bgbtm">
					<div id="sidebar">
						<ul>
							<li>
								@{
									using (var srchFrm = CarrotCakeHtml.BeginSearchForm()) {
										var srch = srchFrm.GetModelHelper();
										<table>
											<tr>
												<td>@srch.TextBoxFor(x => x.query, new { @size = "25", @class = "searchbox" })</td>
												@*<td><input type="submit" class="button" value="Search" /></td>*@
											</tr>
										</table>
									}
								}
							</li>
							<li>
								@Html.Partial("_plainloginout")
							</li>
							@*<li>
									@Html.Partial("_plainforgot")
								</li>*@
							@*<li>
									@Html.Partial("_plainreset")
								</li>*@
							<li>
								<div>
									@CarrotCakeHtml.RenderWidget("phLeftTop")
								</div>
								<div>
									@CarrotCakeHtml.RenderBody(CarrotCakeHtml.TextFieldZone.TextLeft)
								</div>
								<div>
									@CarrotCakeHtml.RenderWidget("phLeftBottom")
								</div>
							</li>
							<li>
								@if (CmsPage.ChildNav.Any()) {
									<h1>Child Pages</h1>
									<ul class="sidemenu">
										@foreach (var itm in CmsPage.ChildNav) {
											<li class="child-nav"><a href="@itm.FileName">@itm.NavigationText</a></li>
										}
									</ul>
								}
							</li>
							<li>
								@if (CmsPage.SiblingNav.Any()) {
									<h1>Sibling Pages</h1>
									<ul class="sidemenu">
										@foreach (var itm in CmsPage.SiblingNav) {
											<li class="child-nav"><a href="@itm.FileName">@itm.NavigationText</a></li>
										}
									</ul>
								}
							</li>
							<li>
								@{
									var updates = CmsPage.GetSiteUpdates(10);
									if (updates.Any()) {
										<h1>Recent Updates</h1>
										<ul class="sidemenu">
											@foreach (var itm in updates) {
												<li class="child-nav">
													<a href="@itm.FileName">
														@itm.NavigationText
														@String.Format(" ({0:d})", itm.GoLiveDate)
													</a>
												</li>
											}
										</ul>
									}
								}
							</li>
						</ul>
					</div>
					<!-- end #sidebar -->
					<div id="content">
						<div class="post">
							<h2>
								@CmsPage.Heading
							</h2>
							<div class="entry">
								<div>
									@CarrotCakeHtml.RenderWidget("phCenterTop")
								</div>
								<div>
									@CarrotCakeHtml.RenderBody(CarrotCakeHtml.TextFieldZone.TextCenter)
								</div>
								@if (CmsPage.ThePage.ContentType == ContentPageType.PageType.BlogEntry) {
									var pagecat = CmsPage.GetPageCategories(25);
									var pagetag = CmsPage.GetPageTags(25);

									<div class="meta">
										@foreach (var itm in pagecat) {
											<span class="meta-item @String.Format("meta-count{0}", CmsPage.GetRoundedMetaPercentage(itm))"><a href="@itm.Uri">@itm.Text</a></span>
										}
									</div>

									<div class="meta">
										@foreach (var itm in pagetag) {
											<span class="meta-item @String.Format("meta-count{0}", CmsPage.GetRoundedMetaPercentage(itm))"><a href="@itm.Uri">@itm.Text</a></span>
										}
									</div>
								}
								<div>
									@CarrotCakeHtml.RenderWidget("phCenterBottom")
								</div>
								<div>
									@Html.Partial("_plaincontact")
								</div>
							</div>
							<div style="clear: both;">
							</div>
							<div class="entry">
								<div>
									@CarrotCakeHtml.RenderWidget("phRightTop")
								</div>
								<div>
									@CarrotCakeHtml.RenderBody(CarrotCakeHtml.TextFieldZone.TextRight)
								</div>
								<div>
									@CarrotCakeHtml.RenderWidget("phRightBottom")
								</div>
							</div>
						</div>

						@if (pager != null && pager.DataSource != null) {
							<div style="clear: both;">
							</div>

							foreach (var item in pager.DataSource) {
								<div>
									<p>
										<b class="green" style="font-size: 110%;">
											<a href="@item.FileName">@item.NavigationText</a> &nbsp;|&nbsp; @String.Format("{0:d}", item.GoLiveDate)
										</b>
										<br />
										by @{
								var usr = item.GetUserInfo();
										}
										@usr.FullName_FirstLast
										<br />
										@item.PageTextPlainSummary
									</p>

									<p class="post-footer align-right">
										<a class="readmore" href="@item.FileName">
											Read more
										</a>
										<span class="comments">
											@String.Format(" Comments ({0}) ", item.CommentCount)
										</span><span class="date">
											@String.Format("{0:MMMM d, yyyy}", item.GoLiveDate)
										</span>
									</p>
								</div>
							}

							<div class="pagerfooterlinks">
								@foreach (var i in pager.PageNumbers) {
									using (CarrotWeb.BeginWrappedItem("div", i, pager.PageNumber, new { @class = "pagerlink selectedwrap" }, new { @class = "pagerlink" })) {
										using (CarrotWeb.BeginWrappedItem("a", i, pager.PageNumber, new { @class = "selected", @href = pager.GetUrl(i) }, new { @href = pager.GetUrl(i) })) {
											@String.Format(" {0} ", i)
										}
									}
								}
							</div>

							<div style="clear: both;">
							</div>
							<br />
						}

						<div style="clear: both;">
							&nbsp;
						</div>
					</div>
					<!-- end #content -->
					<div style="clear: both;">
						&nbsp;
					</div>
				</div>
			</div>
		</div>
		<!-- end #page -->
	</div>
	<div style="clear: both;">
	</div>

	<div id="footer">
		<p>
			@Html.Raw(String.Format("&copy;  {0}, {1} ", DateTime.Now.Year, CmsPage.TheSite.SiteName.Trim()))
			All rights reserved.
		</p>
	</div>

	<!-- end #footer -->
	@CarrotCakeHtml.IncludeFooter()
</body>
</html>